import axios from 'axios'

// axios 设置headers
axios.interceptors.request.use(
    config => {
        const token = sessionStorage.getItem('token');
        if (token) {
            config.headers['authorization'] = token
        }
        return config;
    },
    error => {
        return Promise.reject(error);
    }
);

axios.defaults.baseURL = window.axiosBaseUrl

export { axios }